package arg.program.database;
import java.sql.*;   // Needed for JDBC classes

/**
 * This program creates the LogInDB database.
 */
public class CreateAnimeTable
{
    final String DB_URL = "jdbc:derby:ARGDB";
    
    public CreateAnimeTable()
    {        
       CreateAnimeTable(); 
    }
        

    public void CreateAnimeTable()
    {
        try
        {
            // Create a connection to the database.
            Connection conn =
            DriverManager.getConnection(DB_URL);
            
            // Get a Statement object.
            Statement stmt = conn.createStatement();

            // Add rows to AnimeTable.
            String sql = "INSERT INTO AnimeTable VALUES" +
                    "('VAMK01', 'Vampire Knight', 'Vanpaia Naito'," +
                    "'Yuki Cross, her earliest memory is of snow and blood. "
                    +"She was attacked by a vampire only to be rescued by "
                    +"another. Ten years later and Yuki has been adopted by "
                    +"the headmaster of the prestigious Cross Academy. This "
                    +"school is unique in that it consists of 2 classes. A "
                    +"Day Class and a Night Class. The Night Class is made up "
                    +"of vampires led by Yukis rescuer all those years ago, "
                    +"Kaname Kuran. Together with Zero Kiryu, a childhood "
                    +"friend who despises everything to do with vampires since "
                    +"his family was murdered, Yuki must serve as a Guardian "
                    +"of the school to keep the two classes separated. Secrets "
                    +"lie beneath a peaceful exterior and not everything is as "
                    +"it seems, as Yuki learns the truth about Kaname, Zero "
                    +"and her own forgotten past.',"+ 
                    "'19', 'Shoujo, Romance, Vampire', 'Matsuri Hino', 'null')";
            
            stmt.executeUpdate(sql);
            
            // Close the connection.
            conn.close();
            System.out.println("Updated");
        } 
        catch (Exception ex)
        {
            System.out.println("ERROR: " + ex.getMessage());
        }
    }
}
